const router = require('koa-router')()
const loaderData = require('../util/loaderData')
let users

// 加载用户数据
( async function (){
   
  await loaderData('users').then(data =>{
    users = JSON.parse(data) 
  })
   
})()

router.get('/', async function (ctx, next){
  ctx.body = users;
})


module.exports = router